package com.iwhalecloud.bss.kite.cucc.service.attr.linkhandler;

import com.iwhalecloud.bss.kite.common.constant.KeyConsts;
import com.iwhalecloud.bss.kite.common.util.KiteStringUtils;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.AttackDetectionAttrHandler;
import com.iwhalecloud.bss.kite.cucc.service.attr.handler.BranchAttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.annotation.AttrHandler;
import com.iwhalecloud.bss.kite.listener.handler.attr.impl.AbstractAttrLinkageHandler;
import com.iwhalecloud.bss.kite.manager.inst.KiteAttr;
import com.iwhalecloud.bss.kite.manager.inst.KiteInst;
import com.iwhalecloud.bss.kite.service.attr.AttrData;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;

/**
 * @version V1.0
 * @author:lxb
 * @Package
 * @date:2021/4/15
 */
@Service
@AttrHandler(BranchAttrHandler.class)
public class BranchAttrLinkHandler extends AbstractAttrLinkageHandler<AttrData> {
    @Override
    public void handle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {
        KiteAttr attr25=kiteInst.getAttr("200002825");//分支点是否绑定地址
        KiteAttr attr26=kiteInst.getAttr("200002826");//分支点局域网使用的地址段

        if(KiteStringUtils.equalsAny(kiteAttr.getValue(),"1_0000106")){
            attr25.setShowType("D");
            attr26.setShowType("D");
        }else {
            attr25.setShowType("E");
            attr26.setShowType("E");
        }
   /*     operateSceneInstService.setAttr(data.getSceneInstId(), inst.getInstType(), inst.getInstId(), attr25);
        operateSceneInstService.setAttr(data.getSceneInstId(), inst.getInstType(), inst.getInstId(), attr26);*/

    }

    @Override
    public void handleStyle(KiteAttr kiteAttr, KiteInst kiteInst, AttrData attrData) {

    }
}
